package sctu.edu.java.year2016.team08.lisonghong.day20160521.chapter5_3;

/**
 * 创建一个二维数组，并求所有元素之和
 * Created by 松红 on 2016/5/21.
 */
public class chapter5_3 {
    public static void main(String[] args) {
        int[][] arr = new int[][]{{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                sum = sum + arr[i][j];
            }
        }
        System.out.println(sum);
    }
}
